package ws.jonas.sybosc.chart;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.xy.XYDataset;

public class ChartUtil {
	private ChartUtil() {
	}

	public static ChartPanel createChartPanel(JFreeChart chart) {
		return new ChartPanel(chart);
	}

	public static JFreeChart createBarChart(String title, String xLabel, String yLabel, CategoryDataset dataset) {
		JFreeChart chart = ChartFactory.createBarChart(title, xLabel, yLabel, dataset, PlotOrientation.VERTICAL, true, false, false);
		return chart;
	}

	public static JFreeChart createTimeChart(String title, String xLabel, String yLabel, XYDataset dataset) {
		JFreeChart chart = ChartFactory.createTimeSeriesChart(title, xLabel, yLabel, dataset, true, false, false);
		return chart;
	}
}
